package org.unicase.kineclipse;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;

public class TrimContribution extends
               WorkbenchWindowControlContribution{
    private Label ccCtrl;
    public static TrimContribution instance;
    
    public TrimContribution() {
	super();
	instance = this;
    }
    protected Control createControl(Composite parent) {
	                // Create a composite to place the label in
	                Composite comp = new Composite(parent, SWT.NONE);
	
	                // Give some room around the control
	                FillLayout layout = new FillLayout();
	                layout.marginHeight = 2;
	                layout.marginWidth = 2;
	                comp.setLayout(layout);
	
	                // Create a label for the trim.
	               ccCtrl = new Label(comp, SWT.CENTER);
	               /*ccCtrl.setBackground(parent.getDisplay().getSystemColor(
	                        SWT.COLOR_DARK_BLUE));
	                ccCtrl.setForeground(parent.getDisplay().getSystemColor(
	                        SWT.COLOR_WHITE));*/
	                ccCtrl
	                        .setText("Test"); //$NON-NLS-1$ //$NON-NLS-2$
	                ccCtrl.setToolTipText("Kinclipse"); //$NON-NLS-1$
	
	                return comp;
	            }
    
    public void setText(String msg) {
	ccCtrl.setText(msg);
	ccCtrl.setToolTipText(msg);
	//"contributions.controlContrib1"
    }

}
